home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / Libraries / TransSkel / Demos / C Demos / MiniSkel / MiniSkel.c next >
Encoding:
C/C++ Source or Header  |  1994-02-21  |  1.2 KB  |  50 lines  |  [TEXT/KAHL]

  1. /*
  2.  * TransSkel demonstration:  Minimal application
  3.  *
  4.  * This program does nothing but put up an Apple menu with desk
  5.  * accessories, and a File menu with a Quit item.  The user can
  6.  * run DA's until Quit is selected or command-Q is typed.
  7.  *
  8.  * The project should include this file, TransSkel.c (or a project
  9.  * built from TransSkel.c), and MacTraps.
  10.  *
  11.  * 21 Apr 88    Paul DuBois
  12.  * 29 Jan 89 Version 1.01
  13.  * - Conversion for TransSkel 2.0.  Integer should be a typedef
  14.  * for compiler 2-byte integer type.
  15.  * 12 Jan 91 Version 1.02
  16.  * - Conversion for TransSkel 3.00.
  17.  * 05 Jun 93 Version 1.03
  18.  * - Conversion for THINK C 6.0.
  19.  * 21 Feb 94
  20.  * - Updated for TransSkel 3.11.
  21.  */
  22.  
  23. # include    "TransSkel.h"
  24.  
  25.  
  26. # define    fileMenuID     (skelAppleMenuID + 1)
  27.  
  28.  
  29. static pascal void
  30. DoFileMenu (short item)
  31. {
  32.     SkelStopEventLoop ();            /* tell SkelEventLoop to quit */
  33. }
  34.  
  35.  
  36. int
  37. main (void)
  38. {
  39. MenuHandle    m;
  40.  
  41.     SkelInit ((SkelInitParamsPtr) nil);    /* initialize TransSkel */
  42.     SkelApple (nil, nil);                /* initialize Apple menu */
  43.     m = NewMenu (fileMenuID, "\pFile");    /* create File menu */
  44.     AppendMenu (m, "\pQuit/Q");
  45.     /* install File menu handler */
  46.     (void) SkelMenu (m, DoFileMenu, nil, false, true);
  47.     SkelEventLoop ();                    /* loop 'til Quit selected */
  48.     SkelCleanup ();                        /* clean up */
  49. }
  50.